<template>
  <view class="pink full">

    <view class="slow-blue">
      <view slot="left" class="top left10">
        <a href="http://sao315.com/w/api/saoyisao?redirect_url=http://www.jtyoui.com:20001/api/qrcode/data?code">
          <uni-icons type="scan" :size="30"/>
        </a>
      </view>

      <uni-nav-bar background-color="#5290ff" :border="false">
        <view slot="left" class="leftmost">
          <uni-icons type="contact" :size="50"/>
        </view>
        <view class="text30 top text-white">
          张伟
        </view>
        <view slot="right" class="rightmost">
          <uni-icons type="right" :size="35"></uni-icons>
        </view>
      </uni-nav-bar>

      <view class="top width70p text-center">
        <hr/>
      </view>

      <view class="slow-blue top height40 text-white text-title  text-center">
        <view class="width-half leftmost">1 订单</view>
        <view class="width-half rightmost">10 收藏</view>
      </view>
    </view>

    <view class="width70p text-center">
      <hr/>
    </view>

    <view v-for="certify in certificate.info" class="height40 text-title top">
      <view class="width-half leftmost text-center">{{ certify.key }}</view>
      <view class="width-half rightmost">{{ certify.value }}</view>

      <view class="width70p text-center down10">
        <hr/>
      </view>
    </view>

    <view>
      <button type="primary" class="width70p distance-top25" @click="logout">账户退出</button>
    </view>

  </view>

  <Under :selected="4"/>
</template>

<script setup lang="ts">
import Under from "@/components/tail/under.vue";
import UniIcons from '@dcloudio/uni-ui/lib/uni-icons/uni-icons.vue';
import UniNavBar from '@dcloudio/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue';
import {onMounted, reactive} from "vue";

function scan() {

}

let certificate = reactive({info: []});

onMounted(() => {
  const info = sessionStorage.getItem("info")
  if (info) {
    certificate.info = JSON.parse(info)
    return
  }
})

function logout() {
  sessionStorage.clear()
  uni.switchTab({url: "/pages/index/index"})
}
</script>
